﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RbmlVisualizer.Utilities
{
    public static class NameUtilities
    {
        private const string _classRoleString = "Class Role";
        private const string _classifierRoleString = "Classifier Role";

        public static bool IsRoleClassConcrete(string name)
        {
            return !string.IsNullOrEmpty(name) && name.Contains(_classRoleString);
        }

        internal static string GetNameFromUid(string uid)
        {
            if (string.IsNullOrEmpty(uid))
                return string.Empty;

            var barIndex = uid.IndexOf('|');

            return barIndex == -1 ? uid : uid.Substring(barIndex).Split(' ')[0];
        }
    }
}
